//
//  TestViewController6.swift
//  demo01
//
//  Created by babybus on 2025/7/1.
//
import Foundation
import UIKit
import SnapKit
class TestViewController6:UIViewController{
    private var collectionTest:CollectionSingle!
    override func viewDidLoad(){
        self.navigationController?.navigationBar.backgroundColor = .white
        self.navigationItem.title = "封装测试"
        
        //collectionView初始化
        let layout = UICollectionViewFlowLayout()
        layout.scrollDirection = .vertical
        collectionTest = CollectionSingle(frame: view.bounds, collectionViewLayout: layout)
        
        //按钮组初始化
        let buttonStackView = ColorFuncGroupStack()
//        buttonStackView.configure(action: #selector(buttonFuncTest))
        //加入组件到view
        view.addSubview(collectionTest)
        view.addSubview(buttonStackView)
        
        //位置调整
        collectionTest.snp.makeConstraints { make in
            make.top.equalToSuperview()
            make.left.right.equalToSuperview()
            make.bottom.equalTo(buttonStackView.snp.top).offset(-20)
        }
        
        buttonStackView.snp.makeConstraints { make in
            make.leading.trailing.equalToSuperview().inset(20)
            make.bottom.equalToSuperview().inset(20)
        }
        
        //view
        view.backgroundColor = .gray
    }
    @objc func buttonFuncTest(){
        print("按钮功能测试成功")
    }
    
}
